/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.prefix('/api');

  router.get('/connect', controller.home.index); // hi egg 

  // 用户登陆
  router.post('/login', controller.login.index);
  router.post('/login/register', controller.login.register);
  router.post('/login/resetPass', controller.login.resetPass);

  // users
  router.resources("users", "/users", controller.users)

  // users
  router.resources("activations", "/activations", controller.activations)

  // 邮箱验证 
  router.post("/send/email", controller.sendEmail.send)
  // router.get("/verify/account",controller.sendEmail.verify)

  // 内网分发接口 loadBalancing为前缀  其他为实际接口路径  返回tts/vioceToText调用接口
  router.post("/loadBalancing/al/tts", controller.tts.loadBalancing)
  router.post("/loadBalancing/al/vioceToText", controller.tts.loadBalancing)

  // 测试接口 分发测试
  router.get('/test/mysql', controller.test.mysql);
  router.post('/test/mysqlwrite', controller.test.mysqlWrite); // 测试写入
  router.get('/test/redis', controller.test.redis);

};
